package homework4;

import java.io.Serializable;

/**
 * UserMessage 类的特征有：类型(字符串类型) 和 用户对象(User 类型)。
 */
public class UserMessage implements Serializable {
	private static final long serialVersionUID = -5655295988309080105L;
	private String type;
	private User user;

	public UserMessage() {
	}

	public UserMessage(String type, User user) {
		setType(type);
		setUser(user);
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Override
	public String toString() {
		return "UserMessage{" +
				"type='" + type + '\'' +
				", user=" + user.toString() +
				'}';
	}
}
